/* See LICENSE for copyright and terms of use */

/**
 * <p>Contains a start time and end time, with read-only access.</p>
 *
 * @author Tay Ray Chuan
 */

class org.evtmng.tween.Tween {
	private static var $id:Number = 0;

	private var m_id:Number;

	/**
	 * <p>Returns the <code>id</code>, a unique number, for thie <code>Tween</code>
	 * instance.</p>
	 */
	public function id():Number {
		return m_id;
	}

	private var m_name:String;
	private var m_start:Number;
	private var m_end:Number;

	public function Tween(start:Number, end:Number) {
		m_start = start;
		m_end = end;

		m_id = $id++;
	}

	public function start():Number {
		return m_start;
	}

	public function end():Number {
		return m_end;
	}

	public function duration():Number {
		return m_end - m_start + 1;
	}

	public function setName(name:String):Void {
		m_name = name;
	}

	public function name():String {
		return m_name;
	}
}